package com.cbgolf.oa.model;

import com.cbgolf.oa.base.BaseModel;
import com.cbgolf.oa.contract.ICloseParkListContract;
import com.cbgolf.oa.entity.Beans;
import com.cbgolf.oa.event.Events;
import com.cbgolf.oa.manager.DataManager;
import com.cbgolf.oa.net.NetCallBack;
import com.cbgolf.oa.net.Web;
import com.cbgolf.oa.net.WebAPI;
import org.greenrobot.eventbus.EventBus;

/**
 * Author: lq
 * Created on 2018/6/5
 *
 * @author lq
 */
public class CloseParkListModelImpl extends BaseModel implements ICloseParkListContract.Model {


  @Override
  public void requestData() {

    Web.getOK(WebAPI.close_park_list_get, new NetCallBack(response -> {
      EventBus.getDefault().post(new Events.Builder()
          .msgTarget(DataManager.CLOSE_PARK_LIST)
          .listData(getList(response, Beans.class))
          .errorCode(errorCode)
          .errorMsg(response.errorMsg).build());
    }));

  }
}